22 #define foreach(x, v) for (typeof (v).begin() x = (v).begin(); x != (v).end(); ++x)
23 #define For(i, a, b) for (int i=(a); i<(b); ++i)
24 #define D(x) cout << #x " is " << x << endl
26 const int MAXN
= 1 << 15 + 5;
30 memset(prime
, true, sizeof prime
);
31 prime
[0] = prime
[1] = false;
32 for (int i
=4; i
<MAXN
; i
+= 2) prime
[i
] = false;
33 for (int i
=3; i
<MAXN
; i
+= 2){
35 for (int j
=i
+i
; j
<MAXN
; j
+= i
) prime
[j
] = false;
40 while (scanf("%d", &n
)==1 && n
){
41 int m
= n
/ 2, ans
= prime
[n
-2];
42 for (int a
= 3; a
<= m
; a
+= 2){
43 ans
+= (prime
[a
] && prime
[n
-a
]);